package cn.dankal.basiclib.api;

import java.util.Map;

import cn.dankal.annotations.ApiFactory;
import cn.dankal.business.pojo.BaseBeanList;
import cn.dankal.business.pojo.CommentBean;
import cn.dankal.business.pojo.InfoBean;
import cn.dankal.business.pojo.ReasonBean;
import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;

@ApiFactory(value = FgBaseApi.class)
/**
 * 资讯列表
 */
public interface InfoService {
    /**
     * 车辆资讯列表
     *
     * @return
     */
    @GET("vehicle/info/get/vehicle/info_list")
    Observable<BaseBeanList<InfoBean>> info_list(@Query("pageIndex") String pageIndex,
                                                 @Query("pageSize") String pageSize);


    /**
     * 资讯详情
     * @param uuid
     * @return
     */
    @GET("vehicle/info/get/vehicle/info_details/{uuid}")
    Observable<InfoBean> info_details(@Path("uuid")String uuid);


    /**
     * 点赞
     *
     * @return
     */
    @PUT("user/info/praise_user_info")
    @FormUrlEncoded
    Observable<ReasonBean> praise_user_info(@Field("type") String type,
                                            @Field("uuid") String uuid,@Field("praiseFlag")boolean isPraise);

    /**
     * 评论列表
     * @param pageIndex
     * @param pageSize
     * @return
     */
    @GET("vehicle/info/get/comment_list")
    Observable<BaseBeanList<CommentBean>> comment_list(@Query("uuid")String uuid,@Query("pageIndex") String pageIndex,
                                                       @Query("pageSize") String pageSize);


    /**
     * 咨询评论
     *
     * @return
     */
    @PUT("vehicle/info/comment")
    Observable<ReasonBean> comment(@Body Map<String, String> map);

    /**
     * 咨询 内部评论
     *
     * @param map
     * @return
     */
    @PUT("vehicle/info/inside_comment")
    Observable<ReasonBean> inside_comment(@Body Map<String, Object> map);
}
